package cn.ming.wfchat.app.dialog;

import android.os.Bundle;
import android.view.View;

import androidx.databinding.ViewDataBinding;
import cn.ming.wfchat.R;
import cn.ming.wfchat.databinding.DialogDynameicListBinding;
import cn.ming.wfchat.kit.dialog.CenterDialog;

/**
 * @author luoming
 * created at 2020-05-09 22:24
 * 发布动态
 */
public class DynamicListDialog extends CenterDialog {
    private DialogDynameicListBinding binding;
    private OnClickListener onClickListener;
    private String scrolled;

    /**
     * 定义结果回调接口
     */
    public interface OnClickListener {
        void goText();

        void goPhoto();

        void goShooting();


    }

    public DynamicListDialog setOnClickListener(OnClickListener onClickListener) {
        this.onClickListener = onClickListener;
        return this;
    }


    @Override
    public int getLayoutId() {
        return R.layout.dialog_dynameic_list;
    }


    public static DynamicListDialog newInstance() {
        DynamicListDialog dialog = new DynamicListDialog();
        Bundle bundle = new Bundle();
        dialog.setArguments(bundle);
        return dialog;
    }


    @Override
    public void initView(ViewDataBinding dataBinding) {
        binding = (DialogDynameicListBinding) dataBinding;
        binding.tvCancel.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                dismiss();
            }
        });
        binding.tvPhoto.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                onClickListener.goPhoto();
                dismiss();
            }
        });
        binding.tvShooting.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                onClickListener.goShooting();
                dismiss();
            }
        });
        binding.tvText.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                onClickListener.goText();
                dismiss();
            }
        });


    }

    @Override
    public boolean isBottom() {
        return true;
    }

    @Override
    public boolean isCancele() {
        return false;
    }

}
